﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Zeus.Thunder.Core;
using System.Configuration;
using System.ServiceModel;
using System.ServiceModel.Web;
using Perseus.WCF.REST.Contract.Data;

namespace Perseus.WCF.REST.Client.Basic
{
    class GetEmployeeTest : ITestCase
    {
        public void Run()
        {
            string url = ConfigurationManager.AppSettings["empUrl"];

            using (WebChannelFactory<IEmployeeService> wcf
                = new WebChannelFactory<IEmployeeService>(new Uri(url)))
            {
                var channel = wcf.CreateChannel();
                List<Employee> empList = channel.GetAllEmpByJson().ToList();
                foreach (Employee employee in empList)
                    Console.WriteLine(employee);
            }
        }
    }
}
